package com.fantuan.weixin.impl;

import java.lang.reflect.InvocationTargetException;

import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.lang3.time.DateUtils;
import org.springframework.stereotype.Service;

import com.fantuan.weixin.MessageProcessingHandler;
import com.fantuan.weixin.bean.InMessage;
import com.fantuan.weixin.bean.InMessageText;
import com.fantuan.weixin.bean.OutMessage;
import com.fantuan.weixin.bean.OutMessageText;

@Service
public class MessageProcessingHandlerImpl implements MessageProcessingHandler{

	/**
	 * 测试，原样转回
	 */
	public OutMessage textTypeMsg(InMessage msg) {
		
		InMessageText inMessage = (InMessageText)msg;
		OutMessageText outMessage = new OutMessageText();
		outMessage.setContent(inMessage.getContent());
		outMessage.setCreateTime(System.currentTimeMillis()/DateUtils.MILLIS_PER_SECOND);
		outMessage.setFromUserName(msg.getToUserName());
		outMessage.setToUserName(msg.getFromUserName());
		outMessage.setMsgType(MessageProcessingHandler.MSG_TYPE_TEXT);		
		return outMessage;
	}

	public OutMessage locationTypeMsg(InMessage msg) {
		// TODO Auto-generated method stub
		return null;
	}

	public OutMessage imageTypeMsg(InMessage msg) {
		// TODO Auto-generated method stub
		return null;
	}

	public OutMessage linkTypeMsg(InMessage msg) {
		// TODO Auto-generated method stub
		return null;
	}

	public OutMessage voiceTypeMsg(InMessage msg) {
		// TODO Auto-generated method stub
		return null;
	}

	public OutMessage eventTypeMsg(InMessage msg) {
		// TODO Auto-generated method stub
		return null;
	}


}
